Skip to content

Conversation

@baumea
Copy link
Contributor

@baumea baumea commented May 19, 2025

This PR is based on PR #10, but is logically independent.

  • Adds the command :DelThread in the thread view. This command adds
    the tag "del" to the emails. This command also works in visual mode,
    so multiple threads can be deleted simultaneously.
  • Binds :DelThread to dd in normal mode and d in visual mode.
  • Update the hint text to display dd key.
  • Binds D to the function call purge_del(). With this, emails marked
    to be deleted are removed from the drive. After hitting D, the user
    sees all emails marked to be delete. Puring is then initiated by
    hitting DD (see line 8 in lua/notmuch/delete.lua)

baumea added 2 commits May 19, 2025 21:24
Extended autocompletion:
- `search_terms_list` now also contains `is:`, `to:`, `from`, `body:`
  and the logical expressions `and`, `or`, `not`.
- Added autocomplete functionality for `mimetype:`, `to:`, `from:`,
  `path:`, and `folder:` search.
- Extended `:ComposeMail` to optionally accept recipient, incl. autocomplete

Key binding and visual control
- Extended `:TagAdd`, `:TagRm`, and `:TagToggle` to accept line ranges
- Extended key bindings `+`, `-`, `=`, `a`, `A`, and `x` in the threads
  view to the visual mode
- Added `f` key binding (visual mode and normal mode) in the threads
  view to toggle the `flagged` tag
- Adds the command `:DelThread` in the thread view. This command adds
  the tag "del" to the emails. This command also works in visual mode,
  so multiple threads can be deleted simultaneously.
- Binds `:DelThread` to `dd` in normal mode and `d` in visual mode.
- Update the hint text to display `dd` key.
- Binds `D` to the function call `purge_del()`. With this, emails marked
  to be deleted are removed from the drive. After hitting `D`, the user
  sees all emails marked to be delete. Puring is then initiated by
  hitting `DD` (see line 8 in `lua/notmuch/delete.lua`)
@yousefakbar
Copy link
Owner

Hey @baumea ,

Thanks for another PR, I really like the concept of this change and started using it myself for bulk deleting spam email!

I went ahead and merged this to main along with #10 and partially #12 .

Made some fixes as mentioned in #10 as well:

  • 215cd23: fix: add fail-fast validation for notmuch configuration load
  • 1c1c02f: fix: cross-platform folder/path autocomplete with special char support
  • 0d1786b: perf: optimize bulk thread tagging by reusing DB connection

If you have the time, I'd like to brainstorm how to improve the deletion workflow a bit more. Some comments:

  • There isn't much discoverability of the DD keymap to purge the deleted threads. It would be nice to show it somewhere or hint it to the user
  • Missing a smooth way to undo deletions. Right now you have to manually go find the tag:del threads and remove the tag -- not sure if that is an intentional design
  • No error reporting during deletion failure (especially for deletion this is critical in my opinion and should not be silent)
  • I'm thinking of adding a count in the confirmation to indicate to the user how many threads/messages would be deleted from their store for them to have a sanity check before confirming.
    • By extension, should we add a "dry-run" mode to implicitly show what would happen?
  • I don't understand the and tag:/./. for showing the threads to be purged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants